<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .button1 {
      width: 100px;
      height: 40px;
      background: #eee;
      position: relative;
      align-content: center;
      text-align: center;
      margin: auto;
    }

    .button1::before {
      content: '';
      width: 0;
      height: 0;
      border: 10px solid transparent;
      border-top-color: #eee;
      position: absolute;
      bottom: -20px;
      left: 50%;
      transform: translateX(-50%);
    }

    .button2 {
      width: 100px;
      height: 40px;
      /* background: #eee; */
      position: relative;
      align-content: center;
      text-align: center;
      border-radius: 10px;
      margin-top: 20px;
      overflow: hidden;
      margin: 30px auto;
    }

    .button2::before {
      content: '';
       height: 200%;     width: 200%;

      background: #000;
      position: absolute;
      top: 50%;
      left: 50%;
      transform-origin: 0 0;
      animation: rotate 3s linear infinite;
      z-index: -2;
    }

    @keyframes rotate {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg)
      }

    }

    .button2::after {
      content: '';
      width: calc(100% - 1px);
      height: calc(100% - 1px);
      background: #eee;
      z-index: 1;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      border-radius: 10px;
      z-index: -1;
    }
  </style>
</head>

<body>
  <div class="button1">按钮</div>
  <div class="button2">按钮2</div>
</body>

</html>